﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Diagnostics;

namespace Kindohm.KSynth.Library
{
    public class WaveFormChunk
    {
        public double Slope { get; set; }
        public ushort StartPhase { get; set; }
        public ushort EndPhase { get; set; }
        public short B { get; set; }

        public short GetValue(int x)
        {
            //y = mx + b
            double result = this.Slope * (double)(x - this.StartPhase) + (double)B;
            return (short)result;
        }
    }
}
